home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / BuildingBlocks / EventTimer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  1.2 KB  |  57 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        EventTimer.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef __LIMITS__
  15. #include <Limits.h>
  16. #endif
  17.  
  18. #ifndef __TIMER__
  19. #include <Timer.h>
  20. #endif
  21.  
  22. /***********************************|****************************************/
  23.  
  24. class TEventTimer {
  25. public:
  26.                                     TEventTimer ( void );
  27.                                     ~TEventTimer ( );
  28.  
  29.     void                            Start ( ) ;    
  30.     void                            Stop ( );
  31.     
  32.     Boolean                            IsTimerActive ( ) const;
  33.     Boolean                            IsTimerTaskInQueue ( ) const;
  34.     
  35.     unsigned long                    GetElapsedTimeInMicroseconds ( ) const;
  36.  
  37. private:
  38.     TMTask                            fTimeManagerTask;
  39.     Boolean                            fTimerTaskInQueue;
  40. };
  41.  
  42. /***********************************|****************************************/
  43.  
  44. inline Boolean TEventTimer::IsTimerActive ( ) const
  45. {
  46.     return ( fTimeManagerTask.qType & 0x8000 );
  47. }
  48.  
  49. /***********************************|****************************************/
  50.  
  51. inline Boolean TEventTimer::IsTimerTaskInQueue () const
  52. {
  53.     return fTimerTaskInQueue;
  54. }
  55.  
  56. /***********************************|****************************************/
  57.